Add StM_PROG_M4.
Modify macros to try to make them behave better with shell && and ||

Avoid using the -q option to grep, which supposedly some
implementations are missing.