fixes PR pkg/19996 from Jonathan Perkin. also, don't unnecessarily add -Wl,-R... since LDFLAGS already has it.