Just a quick note on a handy tool for when you are compiling from source. The last step you would normally do when compiling from source is the sudo make install. To uninstall the software later you would use sudo make uninstall.
An alternative is to install the CheckInstall package, which “keeps track of all files installed by a “make install” or equivalent, creates a Slackware, RPM, or Debian package with those files, and adds it to the installed packages database, allowing for easy package removal or distribution”.
For more tips on compiling on Ubuntu, see https://help.ubuntu.com/community/CompilingEasyHowTo