improve package finding

This should fix the lua linking error.