Fix paths issues and make sure z is linked on install