For Ubunty Edgy Eft, ns-allinone-2.30 works without compilation errors. Just make sure you install the X11 development files first:

sudo apt-get install xlibs-dev

In order to install the OLSR add-on from the University of Murcia, go here

Edit: To install on Gutsy Gibbon, install the development files for X Windows:

sudo apt-get install xlibs-static-dev
sudo apt-get install xorg-dev