Unify the detection of the library install location

This centralizes the detection of the proper library install location.