The S&P 500 has posted a respectable 10% gain so far in 2017. Many stocks have failed to keep up with that overall market growth, and a few are lagging for all the wrong reasons. That's how you spring-load a stock for big gains in the near future.

We asked three of our top investors at The Motley Fool to share their best stock ideas for the second half of 2017. They picked undervalued growth machines, perfectly positioned for big jumps in the next two quarters.

Read on to see why you should consider Starbucks (SBUX 0.53%)Ubiquiti Networks (UI 1.62%), and American International Group (AIG 1.70%) right about now.

Stylized chart arrow bouncing off a trampoline, then rising upwards.

Image source: Getty Images.

Ready for a caffeine kick

Keith Noonan (Starbucks): After laying out an ambitious five-year growth plan at the end of 2016, Starbucks appears to be falling behind its targets, but investors willing to look past some short-term setbacks could see great returns with the coffee giant.

Sales over the first half of its current fiscal year are up 6% compared to the prior-year period -- substantially below the 10% annual revenue increase that the company is aiming to hit through fiscal 2021, and last quarter actually saw same-store traffic decline. Earnings are up 14% year over year across the last two quarters, coming in just below the company's annual target of 15% to 20%. These factors might explain why its stock is up just 4% year to date while the S&P 500 has gained roughly 10%, but management expects performance to be much stronger in the second half and that it will still hit its targets.

Beyond the current fiscal year, Starbucks' long-term outlook remains very promising. Between its mobile ordering initiative, push to sell more food products and packaged goods, and plans to grow its store count from 25,000 at the end of 2016 to 37,000 by 2021, the company has a variety of sales and earnings growth opportunities ahead. Starbucks also looks to be a great dividend-growth stock. Its current yield isn't huge at 1.7%, but the company has increased its payout at an average annual rate of 24.7% over the last five years. With a payout ratio of roughly 48% and avenues to sustained earnings growth, it looks like the company is in position to continue delivering substantial annual payout increases. 

Starbucks might have gotten off to a bit of a slow start this year, but there are plenty of reasons to own the stock for the long haul. 

An insurance giant at a discount

Jordan Wathen (American International Group): Shares of this insurance giant trade cheaply, as the market is apparently giving little credit to management changes that I view as a game-changer for AIG shareholders. Earlier this year, Brian Duperreault was named to replace Peter Hancock as AIG's CEO, a move that should yield better results for the insurance company.

Duperreault is the experienced insurance executive that AIG needs. His resume includes stints at ACE Limited, where he served as CEO for nearly a decade. He got his start in insurance at AIG, working in the actuarial department, before advancing into senior leadership roles in many of AIG's far-flung business units.

With the sins of AIG's past mostly papered over by a reinsurance deal with Berkshire Hathaway, it's my view that investors are buying a better balance sheet at a lower price. At an 18% discount to book value, AIG shares are priced as if it will continue to destroy shareholder value with underwriting errors, preferring growth to profits.

Market sentiment could turn in the second half, rewarding investors with a 25% gain if AIG shares trade back to book value. 

It's high time to get over that single earnings miss

Anders Bylund (Ubiquiti Networks): Wireless networking equipment maker Ubiquiti Networks took a breather in 2015, only to come back swinging in 2016. An earnings miss in February of 2017 sent share prices plunging, although Ubiquiti's business is back to its old high-growth ways on both the top and bottom lines.

That's the key takeaway here: The wireless networking expert is trading at a huge discount to its growth potential, and it's all due to a one-time execution mistake in the fall of 2016.

Management admitted that the launch of consumer-oriented routers under the AmpliFi banner could have been smoother. The new products ran into manufacturing issues just as the deadline for holiday store-shelf stocking rolled around, which led to expensive overnight air shipping and poor profit margins for this product line. But the units did reach stores on time, revenue crushed expectations, and Ubiquiti's leadership must have learned some hard lessons from that mishap. I would be shocked to see another last-minute shipping problem, but many investors seem unconvinced for now.

So Ubiquiti shares are sticking to rock-bottom discount levels, trading at just 17 times trailing earnings. Meanwhile, sales are running at a 30% annual growth rate and earnings rose by 22% in the recently reported third quarter.

The stock might not make a full recovery until the next holiday quarter is reported in February of 2018, which only gives you more time to mull over this explosive growth opportunity. When all is said and done, Ubiquiti could very well be the best investment you could make in back half of the calendar year.