In modern times shake a leg means "get a move on" or "hurry up." This has been the case at least since the early 20th century when it was so defined in 1904 in The New York Magazine:
Where Did That Come From? - Shake a leg