[Git][ghc/ghc][wip/mangoiv/improve-linker-discovery] configure: implement a saner linker discovery algorithm in dist/configure