Use c min/max functions and compile with -O3
Add missing dep to list for MHA