To get licked means get defeated. Licked can also mean to pass the tongue over something. Ice cream is a dessert that is licked, or a food that someone keeps passing their tongue over. The problem was "defeated" but the joke uses the word licked which is a verb used to explain how people consume ice cream.
Once ice cream was invented the problem was licked .