Try reordering LDFLAGS...