Take the modified version of the Makefile from MC. Too many changes, mostly lib abi related. Refer to git diff to see them all.