Fix build under llvm

llvm needs explicit linkage to libstdc++ (or -stdlib, but that introduces
compatibility issues with gcc) as well as libm.