Correctly build with libstdc++

Also, general improvements to root `CMakeLists.txt`