Put libraries last in compile command line.

Libraries should be linked after the objects that require them.  This fixes
a link error on ubuntu 14.04.