Change order of dependencies in configure script

Review 1182 by @Tryneus