Should you build custom software or use off-the-shelf tools? Here is the decision framework that saves startups from expensive mistakes.