fixed wrong linking order of libraries in Makefile