add new main.c and fix Makefile/headers