Wrote a makefile and corrected platform-dependent errors in main.cpp