fix environments not to break c++ flags