improved Makefile, moved declarations in main.cpp