How to fix my music library on my iPhone?

I recently built a computer and installed Ubuntu on it. This is my fist experience with Ubuntu so I didn't know much about it and I curiously synced my iPhone music library with the (empty) rythmbox application, thinking it would transfer my songs from my iPhone to the computer. I was wrong. Now all of my songs on my iPhone don't work. How can I fix this? I need my music. (Btw I already tried resyncing it with iTunes it didn't work)

Delete them and if you go on iTunes you go to purchased and then go not on this iPhone and download then again. Hope this helped