Reinstall or if NS is working then follow only install NAM section it will work, it works for me.
How to Install NS-2.35 in Ubuntu- 15.10 / 16.04 Step-by-Step
Refer : https://youtu.be/c5zjM5d7hMI
OR https://www.youtube.com/watch?v=c5zjM5d7hMI&t=6s
Install NS2
First, check that the universe repository is enabled by inspecting '/etc/apt/sources.list' with your favourite editor. You will need to use sudo to ensure that you have permissions to edit the file.
1.) sudo gedit /etc/apt/sources.list
If universe is not included then modify the file so that it does.
2.) deb http://us.archive.ubuntu.com/ubuntu wily main universe
After any changes you should run this command to update your system.
3.) sudo apt-get update
4.) sudo apt-get install ns2
Install Nam
5.) sudo apt-get purge nam
6.) wget --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" "http://technobytz.com/wp-content/uploads/2015/11/nam_1.14_amd64.zip"
7.) unzip nam_1.14_amd64.zip
8.) sudo dpkg -i nam_1.14_amd64.deb
9.) sudo apt-mark hold nam