Stripped thread- what are my options?

Hi, just after a bit of advice, had the mag flange off my engine this afternoon to fit a new mag gasket & repack the bearing with grease & when it came to tighten everything down one of the mag/crankcase nuts wouldn't tighten & just kept spinning, tried a new nut but still no joy, fitted a slightly longer stud which bit slightly but still not enough to hold it tight
just wondered what my options are? can it be taken out to m7 ? or does it need an insert? thanks for any info 

