I had similar experience after upgrading an "XDK for IoT" project to XDK 3759, where my application ran fine after upload but not after unplugging to force restart.
I found it easy to resolve by:
1. ticking the Board Configuration option to "Run previously loaded application at startup",
2. assuring battery had sufficient charge (J3 USB to wall charger), and
3. reinstalling xdk daemon to device for good measure.
25 seconds later I could verify my app was reliably running on startup.
For more complete information about compiler optimizations, see our Optimization Notice.