added makefile and fixed main.cpp