Use CMake to generate Makefile
Fixed bug CMakeLists that caused compile flags to be ignored