After a lot of hurdles finally it was possible for me to configure ns and I am now able to successfully run a script.
Following link provided me the necessary setup:
Steps that i followed were :
tar -xzf "package-name-of-ns-without-quotes"
cd "directory-name-of-ns-without-quotes"
./install
gedit ~/.bashrc (appended at the end of this file)
export PATH=$PATH:"path to the directory location of ns with the directory-name of the package without the quotes"/bin:"path to the directory location of ns with the directory-name of the package without the quotes"/tcl8.5.8/unix:"path to the directory location of ns with the directory-name of the package without the quotes"/tk8.5.8/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"path to the directory location of ns with the directory-name of the package without the quotes"/otcl-1.14:"path to the directory location of ns with the directory-name of the package without the quotes"/lib
export TCL_LIBRARY=$TCL_LIBRARY:"path to the directory location of ns with the directory-name of the package without the quotes"/tcl8.5.8/library
and then
cd ns-2.35 (in the ns directory)
./validate (this will take about one hour, atleast it took on my system)
The reader may have to install some other packages like autoconf,automake,libxmu-dev, libxt-dev,libx11-dev,gcc/c++,x11proto-dev.
A tutorial that I followed:
Useful instructions for installing and configuring is also given at: