Sure, if you want to include a whole lot of things which aren't defense spending and call them defense spending, you might get around 40%. But then, why stop there? By that "reasoning," why wouldn't welfare be defense spending, too, as it's arguably about national security? Hell, 100% of the budget is "defense" spending.
The military budget, according to your own source, is around $680 BN on the high end. Out of a budget of $3.75 TN, that's around 18%.