And BTW, you don't just medicate a dog to "fix it". You medicate it so that it is amenable to training.
Managing Canine Separation Anxiety
From that link:
Crating your dog
One common behavior among dogs suffering from separation anxiety is attempting to escape confinement and find their owners. Crating or containing your dog can result in destruction of the crate or room or in self-injury if she tries to escape. In fact, this practice can escalate symptoms instead of relieving them.
AND:
You are part of the solution
Because separation anxiety is a medical condition, it can be possible to treat it with a combination of medication and training, also known as behavior modification. Elanco’s ReconcileŽ (fluoxetine hydrochloride) for the treatment of canine separation anxiety is a chewable, flavored tablet given once daily. It is FDA-approved for use in dogs in conjunction with a behavior modification plan. When given in combination with the BOND™ simple training plan, Reconcile has shown significant results in treating separation anxiety.
Practicing BOND behavior modification training each day along with the daily dose of Reconcile — and reinforcing it after treatment with Reconcile — will help you manage your dog’s separation anxiety and reduce behaviors associated with the condition.
Time apart will be less stressful for both you and your dog, and your time together will be more enjoyable.