It looks like it's trying to link against OpenSSL but can't find the correct libraries - I'm guessing you built your postgres with SSL support.
Try changing the modlibs line to
MODLIBSÂ = -L$(PGLIB) -lpq -lnsdb -lssl