Fix language checks and pkg-config problem with lua