Fixed the makefile - had library flags in the wrong part.