Further improve consistency of configure's program searching