Fix library search order and recreate cache.lib

Signed-off-by: Charles Steinkuehler <charles@steinkuehler.net>