Hali is completely correct. "Lonelily" is a perfectly good word.
I'm flabbergasted. I would never have believed it. I'm a college-educated U.S. native speaker and I have NEVER seen or heard this word. I would have bet money that it does not exist. But I checked a dictionary and it is there. And there are examples of its use in Project Gutenberg, for example:
"Educated at a provincial academy, he had been removed at the age of sixteen to Rochebriant, and lived there simply and lonelily enough, but still in a sort of feudal state, with an aunt, an elder and unmarried sister to his father."--Edward Bulwer-Lytton
"they say, he used to sit for hours, wrapt up in thought,--brooding lonelily over the first stirrings of passion and
genius in his soul..." --Life of Lord Byron, Thomas Moore
If I saw it in print, I would know what it meant.
I don't think I'd ever use it myself. I don't even know what it means to do something lonelily--either you ARE alone or lonely or you are not, it's not a characteristic of an action. If I had to express the idea itself, I would either use the phrase "in a lonely way."