configure.ac: Use gcc-ar and gcc-ranlib if possible

Recent versions of gcc depend on these wrappers for ar and ranlib to
make LTO work properly, so look for them and use them if possible.