I got it compiled using the -bloadmap, -berok suggestions. Here is my command:
gcc -shared -I/usr/local/pgsql/include -I../aolserver/include -I-/usr/include -Wl,-bimport:./calls.imp -Wl,-bloadmap:loadmap.out -Wl,-berok -o postgres.so postgres.o /usr/local/pgsql/lib/libpq.so -lpthread
I don't know if it will ultimately work, but it did compile.
I populated the calls.imp file with all the undefined symbols I got in my errors, e.g.
#!.
Ns_ConfigGetValue
Tcl_GetInt
NS_DbRegisterDriver
etc, etc.
Thank you all for your help!!
Caroline