./conftest: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
This might be too obvious, but do you have /usr/local/lib in your /etc/ld.so.conf ?
Have you tried setting LD_LIBRARY_PATH to /usr/local/lib?You should also find your mozilla binary and run ldd on it to see what it's trying to link to.
Rgds, Torsten