Fix altprefix PATH discovery, fix LD_LIBRARY_PATH