fix exception handling for TargetMachine
add autoselect ELF generation for MCJIT