flex/bison: Don't hardcode M4 path

The flex and bison configure scripts use AC_PATH_PROG to get a full
path to m4 and embed this in config.h (and then to the generated
binary), but this blows up when the m4 binary is in a temporary
staging directory.

Since we are always shipping GNU m4, just set ac_cv_path_M4=m4 at
configure time so we don't use a hardcoded path.

This is an equivalent to what already exists in autoconf.bb.