Need -ldl on Linux now

Change-Id: I3a207f86611a5078cd2de1437cd48e612232aaf2
Avoid pointless thin wrapper layer

Also works around some warnings from our Clang plug-ins.

Change-Id: Ic9d2bbafefac345b6319300514735143f92dd196