fix configure warnings when lame lib exists but not the headers (closes ...

...#13647)

reordered lame checks. Look for the header first and only after it is found, check the lib too. Otherwise configure will throw "too many arguments" warnings