Rearrange initial config checks: AC, AM, compilers, libtool, basic progs...

Should be a more logical order of checks, from least dependent functions upwards. Helps with readibility also. Should address also https://github.com/bitcoin/bitcoin/pull/5195