I'd figure the easiest solution is to grab an M40 drive shaft as well if you don't want to muck with the output flange. The flanges are the same pattern, right?
There is some adjustability to the two part shafts, but that looks too far to loosen the nut & stretch.