configure: autotools compatibility fixes - step I

Fix proper macro expansion order across autotools versions for
C compiler and preprocessor program checks.