If gcc compiled OK, all dependencies are installed. It may be that you're using libraries from old gcc, such a mixture is not very good. Check your PATH settings (if gcc3.1 was installed from source, you should have path to it there) and /etc/ld.so.conf (are all library directories correct, especially /usr/local/lib - when gcc installed from source?).
If you get more clock errors, look at your time (using 'date' command). Make sure it's correct. A journey into past may be very bad when compiling.