LFortran: Improve detection of implicit link information for lfortran 0.40+
These versions of LFortran support passing -v -Wl,-v to the underlying
compiler so we can extract the full implicit link information.
Issue: #26145 (closed)
Backport: release