If they mean it as a compliment, I thank them and correct them as gently as I can.
If they're trying to be insulting, I usually ignore them, but occasionally I'll mess with their minds a little.

"Nice skirt!"
(Me, looking around confusedly) "Where?"
"Where's what?"
(Me, still acting confused) "The woman in the skirt."
"What woman in a skirt?"
"The one you mentioned."
"When?"
"When you said 'nice skirt'."
etc.

Sometimes it's just fun to see how long it takes them to catch on.