configure: Simplify some library checks via check_lib()