Fix library path determiners.

Migrating Chef to use this script.