Added some simple API to handle the lib directory

The library directory is a lot more variable than it once was, with
lib, lib64, lib/x86..., whatever the person compiling set it too...
Added some minimal API, and changed the places where it was hardwired,
or set to one or two combinations to something that is compiled in.

Change-Id: Ie9d4c4e2ba92dedac5f5cce8da1fa2e0b71e0c4a
Merge topic 'lib-dir' into master

d1350b9d Added some simple API to handle the lib directory