[configure] Check more directories for libgc.

Use a list and a for loop to find the gc library file. We now
also check in /usr/lib64 and /usr/local/lib64 by default.

If there are 32 bit systems that also have a lib64, there might
be issues with this if there is a /usr/lib64/libgc.* but we wanted
to find /usr/local/lib/libgc.* instead. I'm not sure that this
would be an issue in actual practice.

Fixes #833.