Automatically compile mex binaries when missing.

Signed-off-by: acappiello <acappiel@andrew.cmu.edu>