Fix #8451
Fix #8451

On FreeBSD, /usr/lib has to be added to the library path on linking when
libthr is needed but -nostdlib is used (which is the case when the -prof
and -threaded flags are combined).

sdiehl/ghc,ryantm/ghc,acowley/ghc,vikraman/ghc,ezyang/ghc,christiaanb/ghc,olsner/ghc,sgillespie/ghc,TomMD/ghc,GaloisInc/halvm-ghc,fmthoma/ghc,oldmanmike/ghc,mfine/ghc,GaloisInc/halvm-ghc,vikraman/ghc,nkaretnikov/ghc,TomMD/ghc,spacekitteh/smcghc,fmthoma/ghc,fmthoma/ghc,AlexanderPankiv/ghc,jstolarek/ghc,shlevy/ghc,forked-upstream-packages-for-ghcjs/ghc,spacekitteh/smcghc,ezyang/ghc,ryantm/ghc,ezyang/ghc,shlevy/ghc,acowley/ghc,hferreiro/replay,shlevy/ghc,GaloisInc/halvm-ghc,frantisekfarka/ghc-dsi,green-haskell/ghc,lukexi/ghc,gcampax/ghc,shlevy/ghc,forked-upstream-packages-for-ghcjs/ghc,tjakway/ghcjvm,anton-dessiatov/ghc,oldmanmike/ghc,holzensp/ghc,mettekou/ghc,frantisekfarka/ghc-dsi,ml9951/ghc,da-x/ghc,mcschroeder/ghc,wxwxwwxxx/ghc,bitemyapp/ghc,bitemyapp/ghc,lukexi/ghc,da-x/ghc,elieux/ghc,TomMD/ghc,mfine/ghc,lukexi/ghc-7.8-arm64,gridaphobe/ghc,urbanslug/ghc,acowley/ghc,siddhanathan/ghc,green-haskell/ghc,ghc-android/ghc,snoyberg/ghc,lukexi/ghc-7.8-arm64,fmthoma/ghc,TomMD/ghc,fmthoma/ghc,tibbe/ghc,GaloisInc/halvm-ghc,anton-dessiatov/ghc,lukexi/ghc-7.8-arm64,ghc-android/ghc,olsner/ghc,GaloisInc/halvm-ghc,vTurbine/ghc,nathyong/microghc-ghc,mcschroeder/ghc,ml9951/ghc,urbanslug/ghc,green-haskell/ghc,vikraman/ghc,frantisekfarka/ghc-dsi,nathyong/microghc-ghc,snoyberg/ghc,wxwxwwxxx/ghc,gridaphobe/ghc,mcschroeder/ghc,elieux/ghc,nkaretnikov/ghc,hferreiro/replay,gcampax/ghc,lukexi/ghc,AlexanderPankiv/ghc,nathyong/microghc-ghc,ryantm/ghc,mcschroeder/ghc,tibbe/ghc,elieux/ghc,mfine/ghc,acowley/ghc,vTurbine/ghc,olsner/ghc,vikraman/ghc,shlevy/ghc,urbanslug/ghc,da-x/ghc,oldmanmike/ghc,lukexi/ghc,spacekitteh/smcghc,elieux/ghc,ml9951/ghc,urbanslug/ghc,tibbe/ghc,sgillespie/ghc,nkaretnikov/ghc,holzensp/ghc,gridaphobe/ghc,snoyberg/ghc,forked-upstream-packages-for-ghcjs/ghc,nkaretnikov/ghc,gridaphobe/ghc,snoyberg/ghc,frantisekfarka/ghc-dsi,AlexanderPankiv/ghc,gcampax/ghc,anton-dessiatov/ghc,anton-dessiatov/ghc,snoyberg/ghc,vTurbine/ghc,hferreiro/replay,acowley/ghc,spacekitteh/smcghc,olsner/ghc,oldmanmike/ghc,elieux/ghc,wxwxwwxxx/ghc,ezyang/ghc,ml9951/ghc,christiaanb/ghc,sgillespie/ghc,olsner/ghc,spacekitteh/smcghc,holzensp/ghc,gridaphobe/ghc,mfine/ghc,nushio3/ghc,christiaanb/ghc,nathyong/microghc-ghc,bitemyapp/ghc,ghc-android/ghc,vTurbine/ghc,TomMD/ghc,jstolarek/ghc,ghc-android/ghc,siddhanathan/ghc,urbanslug/ghc,fmthoma/ghc,hferreiro/replay,forked-upstream-packages-for-ghcjs/ghc,wxwxwwxxx/ghc,oldmanmike/ghc,ghc-android/ghc,sdiehl/ghc,wxwxwwxxx/ghc,tjakway/ghcjvm,vikraman/ghc,sdiehl/ghc,nkaretnikov/ghc,mettekou/ghc,shlevy/ghc,nushio3/ghc,bitemyapp/ghc,vTurbine/ghc,sgillespie/ghc,gridaphobe/ghc,ezyang/ghc,vTurbine/ghc,ml9951/ghc,sgillespie/ghc,wxwxwwxxx/ghc,tjakway/ghcjvm,ghc-android/ghc,oldmanmike/ghc,AlexanderPankiv/ghc,tjakway/ghcjvm,christiaanb/ghc,anton-dessiatov/ghc,sdiehl/ghc,urbanslug/ghc,anton-dessiatov/ghc,mettekou/ghc,nushio3/ghc,siddhanathan/ghc,mettekou/ghc,sdiehl/ghc,ml9951/ghc,frantisekfarka/ghc-dsi,acowley/ghc,fmthoma/ghc,nkaretnikov/ghc,gcampax/ghc,nkaretnikov/ghc,lukexi/ghc-7.8-arm64,AlexanderPankiv/ghc,AlexanderPankiv/ghc,hferreiro/replay,forked-upstream-packages-for-ghcjs/ghc,snoyberg/ghc,olsner/ghc,shlevy/ghc,sdiehl/ghc,siddhanathan/ghc,hferreiro/replay,da-x/ghc,ml9951/ghc,gridaphobe/ghc,mettekou/ghc,jstolarek/ghc,da-x/ghc,nathyong/microghc-ghc,gcampax/ghc,urbanslug/ghc,mfine/ghc,tibbe/ghc,olsner/ghc,GaloisInc/halvm-ghc,TomMD/ghc,nushio3/ghc,vTurbine/ghc,sgillespie/ghc,nathyong/microghc-ghc,tjakway/ghcjvm,snoyberg/ghc,elieux/ghc,siddhanathan/ghc,mettekou/ghc,mfine/ghc,gcampax/ghc,tjakway/ghcjvm,wxwxwwxxx/ghc,tjakway/ghcjvm,lukexi/ghc-7.8-arm64,forked-upstream-packages-for-ghcjs/ghc,TomMD/ghc,christiaanb/ghc,christiaanb/ghc,ezyang/ghc,nushio3/ghc,siddhanathan/ghc,green-haskell/ghc,da-x/ghc,green-haskell/ghc,bitemyapp/ghc,anton-dessiatov/ghc,mcschroeder/ghc,mfine/ghc,sdiehl/ghc,holzensp/ghc,da-x/ghc,lukexi/ghc,ghc-android/ghc,vikraman/ghc,hferreiro/replay,jstolarek/ghc,mettekou/ghc,mcschroeder/ghc,jstolarek/ghc,siddhanathan/ghc,acowley/ghc,ezyang/ghc,mcschroeder/ghc,nushio3/ghc,christiaanb/ghc,AlexanderPankiv/ghc,oldmanmike/ghc,nathyong/microghc-ghc,ml9951/ghc,ryantm/ghc,GaloisInc/halvm-ghc,ryantm/ghc,vikraman/ghc,forked-upstream-packages-for-ghcjs/ghc,sgillespie/ghc,elieux/ghc,holzensp/ghc,nushio3/ghc,gcampax/ghc,tibbe/ghc