Here's how I got this working (on Linux Mint, which has worked for everything I've done on Ubuntu)
Dependencies for building the install:
Install cmake
sudo apt-get install build-essential -y
Install boost
sudo apt-get install libboost-all-dev
Install expat
sudo apt-get install expat libexpat1-dev
Install libpqf (if necessary)
sudo apt-get install libpq-dev
Once you've got that going, the "installation" found on the osm2pgrouting github page work just fine:
cmake -H. -Bbuild
cd build/
make
make install
To run the tool, it seems you have to be in the directory mentioned in the other answer, which you can get to with:
cd /usr/share/bin
Now the command on the github page is different than the command on the official PGRouting Page, which combined with the github code, is based on this command:
./osm2pgrouting -file your-OSM-XML-File.osm -conf mapconfig.xml -dbname routing -user postgres -clean
My command looked like:
./osm2pgrouting -file ~/Documents/pgrouting/osm2pgrouting-master/denver-boulder_colorado.osm -conf ~/Documents/pgrouting/osm2pgrouting-master/mapconfig.xml -host localhost -dbname postgres -user matthew -clean
Notice I also had to specify the path to the mapconfig.xml file...
So when the command is run and all is said and done the message you should get look something like this:
Create Topology success
#########################
size of streets: 154076
size of splitted ways : 379396
finished
Now on to some routing!
locate osm2pgrouting
print?