Through some odd chance, the word “lick” in American speech acquired the meaning “a spurt of speed; also, a burst of energy.”
This meaning found its way into print early in the nineteenth century. Our present phrase was derived from that sense and is graphically illustrated by the line from “Polly Peablossoin’s Wedding”, published in 1851 by T. A. Burke.
The line reads, “I saw comin’ my gray mule, puttin’ in her best licks, and a few yards behind her was a grizzly.”
We also say, to put in “solid” licks, or “good” licks.