better build system checking for c++11 and adding to CXXFLAGS