configure: simplify check_lib2