Fix libraries in generated makefiles