fix cxx flag handling in thumbs