Having the link check in the header check loop means we get -lminiupnpc -lminiupnpc -lminiupnpc on the link line.
This is unnecessary, and results in warnings, i.e:
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
These warnings have been occurring since the new macOS linker released with Xcode 15, and also came up in https://github.com/hebasto/bitcoin/pull/34.
There are other duplicate lib issues, i.e with -levent + -levent_pthreads -levent, but those are less straight forward to solve, and won't be included here.