Rearrange lib directory detection, fixes #587
Merge pull request #590 from wiredfool/ppc-setup

Rearrange lib directory detection, fixes #587