First of all, you have to understand that ID-ing a theme/motif and Aural/Ear training are different things.
ID-ing is about how much you listen to music. Sometimes it's about memory. Ear Training is being able to pick the Tonic (Relatively) of the Music played and arrange the heard notes by perceiving the intervals between notes correctly.
If you want to ID a song's Title, you just have to listen to music. Yours friends are able to do it because they've heard that melody before. Listening to music is the only way to know their titles, there's no other way as the Title has nothing derivative from the Music/Melody line.
Identifying for a example a piece from Mozart is not the same as Shazam-ing a supermarket song though. Whatever you are looking for is Active Listening, I guess. More of like when you listen to some music, You Really Really pay attention to whats going on in that (Melody Line in this case).
Actively listen to the melody line of a piece of music next time you here any. You have to read the title before you actually listen to the song (Read the title atleast once). Pay enough attention it such that if it's played you'd be able to identify it.
I hope this answers it.