I see two ways to fix this.
A) It looks like part of the female threads (black plastic) are still on the metal male threads. First thing you'll need to do is GENTLY remove this broken piece. You may be able to twist it off with your fingers, depending on how tight it is. Otherwise, take a pair of pliers and twist it off.
B) Rotate the ball in the socket so that it is about centered in the head (so that any glue is less likely to get into the joint). Take the black plastic piece and position it back against the tripod head and rotate it until you find the position it was in when it broke. Make a small mark in the same place on both the black piece as well as the head with a sharpie, whiteout, pen, or pencil. This will show you the proper orientation. Put a moderate amount of Super Glue on the ball and realign the broken plastic piece. Press the two pieces together for at least 60 second being careful not to move either piece. Once it has cured (at least 2 hours), run a small bead of Super Glue around the break to reinforce it. Wait 24 hours and then reassemble. It won't be as strong as it was, but it should work for a while.
Option 2. (if Option 1 fails)
A) Do step A) from above, place the broken piece back on the male thread, add a generous amount of "5 Minute" epoxy (I've personally not had luck with JB weld...) to the male threads and broken plastic piece and press it back together. Hold it for a couple minutes and it should be as good as new.