Fixes to build with ToT / M4 Macro Fix

Various header files/APIs have changed.
Cleaned up library link order in Makefile to build with ToT.
Fixed M4 macro to emit legal LLVM IR: fcmp oeq instead of fcmp eq