AOLServer4 has split DB support out into a separate library, which the nspostgres Makefile doesn't yet know about - you'll need to find the MODLIBS line under the "Libraries required by this module" section heading and change it from
MODLIBS = -L$(PGLIB) -lpq
to
MODLIBS = -L$(PGLIB) -lpq -lnsdb