They're also remnants of old Japanese. り was the old counter for people, like つ was the old counter for objects (the newer ones are にん and こ, respectively). Also, か was for days, now mostly taken over by にち, and it seems ち/ぢ was for years, now taken over by さい (notable exceptions being 二十歳(はたち) and 三十路(みそじ), though I'm not sure why 路 is in there. Must be a rebus).