I would try glueing the frame first. Take the door out of the opening and remove the hinge. Open the seam and fill it with glue. Get the gue in the crack as deep as you can. Close the crack and either nail or screw the frame edge. Let is stand 24 hours and the reinstall the door and hinge.
Ron
Ron