configure: Make the libjpeg soname check depend on the header check.