For people I've known in relationship who experienced loss of sex drive from SSRIs or other antidepressants, switching to Wellbutrin (buproprion) was often the antidote (so much in some cases that it's actually been suggested as an aphrodisiac).
Compulsive masturbation itself in adolescents was cited as a sign of depression by the late sexologist and collaborator with Alfred Kinsley, Wardell Pomeroy (the author of "Boys and Sex" [1968] and "Girls and Sex" [1970], two books every parent of adolescent children should read before handing them over to their children to learn from - my mother obtained them and wisely read both, then handed them to my father to give to me, but my elementary school principal jackass father was too stupid and lazy to read them first himself, and they contradicted EVERYTHING he told me - teachers and psychologists make the worst, most stupid and abusive parents, along with Marine Corps servicemen like him).
After reading Pomeroy, I recognized by how much I masturbated how depressed I was or wasn't. The more depressed I was, the more I did it. When I originally went I Prozac, I didn't want to masturbate at all, and was very pleased about that. I knew the Prozac was wearing off and losing efficacy when I relapsed into those urges and behavior. (My fuckhead elementary school principal father just told me and my brothers to run cold water over ourselves or take cold showers, then juts forget about it. He also told us masturbation causes cancer and that erections were a warning from Jesus. Again, there's nothing on Earth more completely stupid than degrees, especially advanced degrees in education or psychology. A college degree truly is proof of lack of intelligence.)