Is there a fallback plan if bitcoin's underlying cryptography is cracked? Lets say someone started making real viable quantum computers that were affordable enough that large companies could buy one. And lets say a quantum algorithm was devised to crack the private keys of bitcoin public keys in days rather than years. 

Is there a plan for that possibility? What would happen? Would there be a smooth migration to another system? Would bitcoin be able to update somehow to protect itself from such a breach?
No, there is no explicit, publicly-disclosed plan for this situation.

However, there is an implicit plan: when it becomes know that practical quantum computers are on the near-term horizion, the programmers responsible for maintaining Bitcoin at that point will create a hard fork or soft fork to introduce a new signature type, likely something based on Lamport signatures or Merkle signatures.

Users will upgrade their wallets to wallets which support the new signature type and spend their bitcoins from their old private keys to their new private keys.  This is pretty much identical to what Android users had to do for the SecureRandom bug.

This is all very easy if done in non-rushed manner, and fast quantum computing is still a ways off, which is one reason nobody is working on this now.  The other reason is that the proposed new signature types are all much larger than the secp256k1 ECDSA signatures we use now, so using them would increase block chain bloat.

Note: the question mentions the cracking of private keys from public keys, which could be done on a fast quantum computer using Shor's algorithm.  However, in the comments, the OP (B.T.) focuses on cracking SHA256 (which would likely be done using a different algorithm; I don't know which).

The answer above focuses on the private key problem, but the solution for the proof of work problem is the same: a hard fork or soft fork to change the hashing algorithm to make its most difficult value even more difficult.  Again, as long as we have months or years to make the change, this is an easy upgrade, so there's no sense in performing it prematurely.