Ubuntu 11.10 (should also work for Kubuntu)
sudo apt-get install build-essential subversion libsdl1.2-dev libgtk2.0-dev libgconf2-dev libsdl-ttf2.0-dev
For Ubuntu 12.10 make that:
sudo apt-get install build-essential subversion libsdl1.2-dev libgtk2.0-dev libgconf2-dev libsdl-ttf2.0-dev gcc-4.6 g++-4.6
On 12.10, for MAME versions 0.147u5 and later 12.10 will be auto-detected and it will prompt you to install gcc-4.6 and g++-4.6 if you haven't already. If you do have them installed, it will build automatically. For 0.147u4 and earlier, you must "make DISTRO=gcc46-generic".
I believe this should be all you need, if not please correct me.
play0r
[RB - updated Jan. 2013 for 12.10 and latest MAME/MESS]