Old English lama "crippled, lame; paralytic, weak," from Proto-Germanic *lama- "weak-limbed" (source also of Old Norse lami "lame, maimed," Dutch and Old Frisian lam, German lahm "lame"), literally "broken," from PIE root *lem- "to break; broken," with derivatives meaning "crippled" (source also of Old Church Slavonic lomiti "to break," Lithuanian luomas "lame").
In Middle English especially "crippled in the feet," but also "crippled in the hands; disabled by disease; maimed." Figurative sense of "imperfect" is from late 14c. Sense of "socially awkward" is attested from 1942. Noun meaning "crippled persons collectively" is in late Old English. To come by the lame post (17c.-18c.) was an old colloquialism in reference to tardy mails or news out-of-date.
-ly 2
common adverbial suffix, forming from adjectives adverbs signifying "in a manner denoted by" the adjective, Middle English, from Old English -lice, from Proto-Germanic *-liko- (cognates: Old Frisian -like, Old Saxon -liko, Dutch -lijk, Old High German -licho, German -lich, Old Norse -liga, Gothic -leiko); see -ly (1). Cognate with lich, and identical with like (adj.).
Weekley notes as "curious" that Germanic uses a word essentially meaning "body" for the adverbial formation, while Romanic uses one meaning "mind" (as in French constamment from Latin constanti mente). The modern English form emerged in late Middle English, probably from influence of Old Norse -liga.