Added back C++ compiler option required by OSX.

The compiler option '-stdlib=libstdc++' is required for building
on OS-X 10.9
This change adds the flag back again but tests the operating
system to prevent problems on other systems.