change compile command for c++ and add c++11 flag