Phantom pain is caused by inappropriate signals from the nerves in the leg stump, including phantom positioning of the non existent leg. So the treatment is difficult, but can be done. Standard pain relievers are not usually effective, but some folk benefit from Amitryptiline, which is an antidepressant, but occasionally useful in neuropathy. There is also gabapentin, and pregabalin, which were born as anti epilepsy treatment, which work better.
You need to discuss this with your GP initially, but in the meantime look on your preferred search engine for amputee groups who have far more information on this condition, and its treatment. There’s far more people with this condition than are on this forum.
Let us know how you get on.