configure: Simplify AltiVec/VSX check with a helper function