Yep, bug in configure.
Try to run configure this way:
$ LDFLAGS="-L/path/to/libgd" ./configure --with-server --with-mysql --with-nxhttpd
"/path/to/libgd" will be "/usr/local/lib", probably.
Try to run configure this way:
$ LDFLAGS="-L/path/to/libgd" ./configure --with-server --with-mysql --with-nxhttpd
"/path/to/libgd" will be "/usr/local/lib", probably.