Added makefile and updated main.cc for supporting older compilers.