bindist configure fails when LDFLAGS contains pack-relative-locs
## Summary
Running `./configure` from the bindist with an `LDFLAGS` containing `-Wl,-z,pack-relative-relocs` fails when trying to `determine machine word size`. I run into this issue when installing a GHC through stack within a `PKGBUILD` on Arch Linux -- the default `LDFLAGS` setting there contains `-Wl,-z,pack-relative-relocs` since [last month](https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/commit/0f10f032b02bc7823b3ac11f4807b5515c996821).
Raised the issue both in [`stack`](https://github.com/commercialhaskell/stack/issues/6525) and [Arch Linux](https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/issues/21) repos before being prodded by @maerwald that this might need to be addressed via GHC as well
GHC isn't the only Haskell program affected, I similarly have trouble building `unix` and `network`. I haven't investigated these in-depth, but suspect the issue is a similar use of autoconfig for the ffi bits which fails. Raised issue in [`cabal`](https://github.com/haskell/cabal/issues/9828) to see if they can't similarly select `$LD` based on `$LDFLAGS`.
## Steps to reproduce
With eg the [9.6.4 fedora bindist](https://downloads.haskell.org/~ghc/9.6.4/ghc-9.6.4-x86_64-fedora33-linux.tar.xz):
```bash
export LDFLAGS='-Wl,-z,pack-relative-relocs'
./configure
```
## Expected behavior
Configuration should succeed, just like it does without `LDFLAGS` set.
## Environment
* GHC version used: 9.6.4
Optional:
* Operating System: Arch Linux
* System Architecture: x86_64
issue