When you choose the architecture, it means the compilation will generate code for some processor family, and you'll have trouble if you change to a different one. If you change to a compatible processor, it should work fine.
If, for example, you compile for an Intel Core i3, switching to an Intel Core i5 will work fine, but might not if you switch to an AMD A10, depending on what you targeted.
There are different levels of generality. If you compile for older architectures, it's more likely to get a binary that can run on different processors, at the expense of losing some optimizations.
Wilf is compiling to i586, which is a Pentium 32 instruction set. Any modern processor will run that, but it won't make many optimizations. i586 code will run both on an Intel Core i5 and on an AMD A10, and also on a Celeron, on a Pentium III and on many others (32 and 64 bits). If you have a 64 bit processor, compile to a 64 bit family, or you won't be really optimizing much.
If you're changing your processor only, not the whole motherboard, to a newer one, you should be fairly safe, as most differences should be between processors using different sockets, AND you're likely changing to a newer version of roughly the same technology.