improved the handling of g++ and ld flags in Makefiles, implemented exception handling within Python - replaced C++ aborts with exceptions that can be caught by Python