Assuming the drive shaft is vertically and horizontally in the correct position, the engine
mounts (possibly all of them) need to be adjusted (possibly both vertically and horizontally so the engine flange meets the other flange parallel.
For starters, Turn both shafts to make sure both flanges are at 90 degrees to their respective shafts as well.
Measure the runout at the top bottom and both sides as you turn one shaft.
This will give you an idea of how true the flange is.
Repeat with the other flange.
You need to eliminate the possibility of a slightly bent drive flange or you will be tearing out your hair trying to get it right.