added compile flags for C++ on non-C++ petsc builds
3d doesn't work now. Trying to debug