How do you boost GDP? Women and guns

The Boko Haram kidnapping in Nigeria is putting a spotlight on a problem that no amount of natural resources, foreign investment, or Twitter campaigns can fix: Islamist-imposed gender inequality.

And it's also making the solution to this problem crystal clear.

First, let's diagnose the disease.

Jason Zielinski shows a customer an AR-15 style rifle at Freddie Bear Sports sporting goods store.
Getty Images
Jason Zielinski shows a customer an AR-15 style rifle at Freddie Bear Sports sporting goods store.

Many experts have recently chimed in about the political freedoms that are denied in nations where women are not educated or employed in large numbers. But this is really an economic problem and a key symptom of the economic woes plaguing the developing world, especially in the Middle East and Africa.

Read MoreOp-ed: Sorry, China is NOT about to be the No. 1 economy

It's very simple: If groups like Boko Haram and repressive regimes like Saudi Arabia successfully continue to keep girls out of schools, they'll never remain or become serious players on the economic scene. Because educating girls creates a dual economic powerhouse, building a massive populations of producers and consumers simultaneously.

Study after study shows that there is a GDP boost in countries that educate their women. And some economists predict that incomes will grow 20 percent higher in the developing nations that use education to narrow their employment gender gap.

So how do we make this happen?

Kathy Matsui of Goldman Sachs, makes the well-intentioned suggestion that foreign investors should help set up schools along with the factories and oil fields they build in the developing world.

Not a bad idea, but not enough.

Others, like New York Times columnist Nicholas Kristoff suggest sending donations to charitable organizations setting up schools for girls and lobbying Congress to pass international laws banning violence against women. Nice thoughts.

But we've known since the days of Adam Smith what it really takes to secure economic and educational freedom.

I'm sorry to say it, but to save and increase the number of girls in schools we need men with guns.

Read MoreRemington under fire: A CNBC investigation

Boko Haram, Al Qaeda, Hezbollah and repressive regimes like Iran, Saudi Arabia etc. aren't fooling around. They aren't just threatening to violently stop women and girls from being educated or economically emancipated, they're doing it all the time.

They've made it impossible for women to do business without massive amounts of private security in too much of the world. Places like Nigeria and Iraq have central marketplaces for human trafficking — mostly of women. Do you think slavery is about 19th century Southern plantations like you saw in "12 Years a Slave?" Think again: There are more people enslaved now than ever before in world history — an estimated 20 million.

And unless the nations and people they're targeting, especially their own women, don't respond with deadly force there's no chance to "bring back our girls" or get most of them inside a school or an office building in the first place.

It was Smith in his 1776 book "Wealth of Nations," who said that prosperity depends on peace, low taxes and a good system of justice.

When men with guns like Boko Haram are attacking schools, there is no peace. And the only response that will work is a military response (i.e., the good men with guns).

Read MoreObama & Bloomberg: Best gun salesmen EVER

And these protective armies must be maintained and armed by the local governments. The U.S. and the rest of the West can help with funding and advice, but unless these developing nations do it on their own the terrorists will simply wait until we lose the interest and stamina to stay overseas.

The wars in Iraq and Afghanistan produced a bumper crop of political and economic experts who told us that wars are bad for the economy. I suggest they go to Nigeria and see the alternative.

Men with guns are needed for an economy to thrive, and if they succeed in securing educational equality in everything from the developing world's hospitals to military schools, one day the women with guns will protect them too.

Commentary by Jake Novak, supervising producer of "Street Signs." Follow him on Twitter @jakejakeny.