amin amax implementation. libmath in Makefile