Not have a business model predicated on datamining users' information, and build their systems in such a way that they are unable to collect troves of unnecessary information.
But the only way we'll ever see any change is through users/developers: Detach yourself from such businesses. Don't build your dream on top of their corrupted platform. And if you must use some of their services for pragmatic reasons, consider them hostile governmental entities and thoroughly understand what you are giving away to be stored indefinitely.
Even if we demolished the NSA and put the traitors' heads on pikes, it would only be a matter of time until insurance companies robustly created similar chilling effects: https://news.ycombinator.com/item?id=7928484