Used LDLIBS instead of LDFLAGS where applicable