From what I understood from a little research I did at the time, your body is literally getting addicted to the touch of your partner and to the chemicals that are released in your body as a result. I recall something about a psychological addiction as well. When you don't get that stimulus from your partner you get the annoying feeling of emptiness that doesn't seem to go away. Your body craves it, it's literally a drug.
This won't make that feeling go away any faster, but it should help put things into perspective and put a smile on your face whenever you're feeling like sh!t. Realize you're just a machine suffering from it's own mechanics - avoid attaching any self-deprecating meanings to that feeling and trying to rationalize it beyond this biological process. As always, easier said than done.
I suppose casual sex does give you temporarily a good feeling since it gives you yet another small dose of that drug, but a short while after the sex is over you're back at square one. That is unless you can get into a new relationship which can be a new constant supply of that drug, in which case you should be back to feeling good again for as long as it lasts.
The alternative is to let your body go through the "rehab" process, which feels like sh!t, but when it's over you're back to normal.
This is based on research + personal experience, feel free to correct me if any / all of my points and deductions are wrong.