fixed installation of libraries to be conditional on the library being built