And おはよう comes from お早い ("early"), ありがとう from 有り難い ("difficult to exist"), すみません is 済みません ("it will not end"), etc.
Isn't etymology fun?!
I wonder if there's an online Japanese etymological dictionary like this amazing English one:
Online Etymology Dictionary