Respect LDFLAGS, minor other improvements