fix building using --with-pth - include LDFLAGS with library