properly set CMAKE_CXX_FLAGS if they are passed in from outside
fixes building on ubuntu 12.04