Configure supports to select debug and release version.
Configure check for appropriate MPI prototypes (add const for MPICH 3)