Welcome to LQ.
Fixing nam with the patch tk-8.4-lastevent.patch
cd ns-allinone-2.29/tk8*/
wget
ftp://ftp.swin.edu.au/gentoo-portage...astevent.patch
( Or just download the patch to ns-allinone-2.29/tk8* )
patch -p0 < tk-8.4-lastevent.patch
cd unix/ && make clean && rm Makefile ( If make didn't delete 'Makefile'.)
cd ../ && ./configure && make
cd ../nam-*/ && ./configure && make
.