Removing link problems with g++ on some systems.

Compiling with g++ but linking with gcc leads to problems
on some systems, with a missing __gxx_personality_v0 symbol.
We attempt to fix this by disabling unnecessary features
(we only use C++ for templating convenience).