use LDFLAGS and LDLIBS correctly