I tried, but didn't find a good solution. A good comment was: https://github.com/mongodb/mongo/commit/2daa35d735fad02c9e902842f63f6b83724fbd98, however even with this patch, the CXXFLAGS environment variable was ignored.

The master branch of mongo does not need libstdc++, that's why they have very little reason to add this option there.