Four short lines, and they turn on a pun. "Sea legs" is the knack of staying upright on a rolling boat, but here the speaker's legs seem to lose that knack. The speaker takes both legs "to the leg of a ham," which is a strange, funny picture: human limbs set beside a cured joint of meat. It suggests a body that feels heavy, clumsy and not quite alive, more meat than muscle.
Then comes the quarrel. The legs and the ham argue "like words in a well," and that image is harder to pin down. Words in a well would echo, bounce off the walls and come back garbled, with no one able to answer clearly. That fits the dizzy, muddled feeling of being unsteady at sea.
The mood is playful but a little queasy. The speaker seems to be laughing at their own awkwardness while also admitting how disorienting it is, and the poem lets sound and wordplay do the work of motion.