Fix solib file name on MacOS X

On MacOS X the library version goes before the library extension (dylib).  This
patch adds two helper functions that are used by the install rule to get the
correct library file name.