For this tutorial, I assume that you already have installed NS3 on your ubuntu machine.
If you installed NS3 withe examples and other components, than you should see in your root NS3 folder netanim directory:
/home/mickey/ns3_git/qkd-routing/ns-allinone-3.22# ls bake build.py constants.py constants.pyc netanim-3.105 ns-3.22 pybindgen-0.17.0.886 README util.py util.pyc
Now, go to your netanim directory and execute:
/home/mickey/ns3_git/qkd-routing/ns-allinone-3.22# cd netanim-3.105/ /home/mickey/ns3_git/qkd-routing/ns-allinone-3.22/netanim-3.105# qmake make
You should have netanim installed.