It could be, in that world of probability and such, that he was:
a) trying to give you a natural complement, and wasn't very good at it
b) trying to be sarcastic, and wasn't good at that either
c) a serial killer assessing you as his next victim
d) just another (lonely) person trying to make some contact
I'm betting on D.
And you may have been dressing sexy for your GF, but you live in the real world, and other people see you too. If you look nice, then they can notice you look nice, and hopefully are making a statement of beauty, grace and all that in a dreary world and making up for them having to see people like me often dressed in clothes that homeless people wouldn't wear and covered in dirt, grease and paint. It's OK to notice pretty people. And lots of people do.
I'm always conscious that any time a man imposes his attention on a woman, he's a potential attacker, no matter how nice or timid he seems-- that kind of behavior from a random male stranger is out of bounds.
Granted that every man could be a potential attacker, the fact of the matter is that the odds are he is not. Like I said, he might have just been on the most clumsy side of his social skills. Overwhelming odds are, it was just some guy at Target.
And I'm not sure where exactly that line is between being friendly and "unwanted attention" - I talk to people all the time, in line, waiting for lights to turn at crosswalks, on the bus, waiting for the bus and just walking down the street. I complement a lot of people, guy I just quote ZZ Top and say 'everybody's crazy 'bout a sharp dressed man' and with women I might be more detailed, or point out exactly what it is in that style that I like. Usually, that does begin a conversation, at least one on clothes and shopping.
Lots of people dress to look good, its OK to notice it I think. And I know that the results are not all one sided. For every women that does not like it, there are some who do - which makes it hard for men to even begin to know.
But she had a little kid with her, and her skirt was ankle-length, which is not generally what attracts men, is it? What, the long skirt, or the rugrat in tow? In general I don't think the skirt matters, but I would think most guys try to shy away from trying to pick up women with kids.