Updated makefile to actually work correctly and use macros
Moved main into its own file