Updated to deal with latest khmer version

@mr-c, could you take a quick look and sign off?  It does run from scratch :)