I believe this build failure occurs when USE="nse -libssh2" as a result of upstream b57d23f005ee8a22792ecfb0d6e506a139f8c757 combined with the ebuild tying --with-zlib to libssh2. With USE="nse -libssh" -lz is missing during linking with nds_zlib.o. USE=nse now also requires configure --with-zlib. It does not appear any released version of nmap is affected at this time. Reproducible: Always
The actual problem is that --with-zlib defines ZLIB_LIBS but Makefile.in inexplicably uses LIBZLIB_LIBS.