Based on your clarification, I think that you were re-targeted based on your IP address and some personal/demographic qualities.
I assume you understand that if it happened on the same computer, or while logged in to your FB on both computers, it was simple retargeting - Amazon showing recent product searches as a FB ad to FB users who visited the same product in the past X days.
Since FB doesn't reveal its ad-serving algorithm, I can only guess here, so I apologize in advance for the opinion-based answer.
I do have experience with FB ads and met with their representatives personally more than once, when they demonstrated the FB ads features. These guys claimed that FB ad serving algo is a "black box" that uses a lot of data for ad matching.
In any case, depending on the products you were searching, you might have been retargeted based on your interests on FB in addition to your IP address and recognized as the user who searched Amazon.
For example, if you're a 16 year-old male, and you were looking for video games on Amazon on your parents' computer, the connection could be made on FB's back-end that it was in fact you, because you're probably connected to your parents' FB accounts, you're on the same IP, and the interest in those specific ads fits your demographic much more than that of your parents.
To me, this is the most logical theory. I hope it makes sense.
Here's some interesting reading material about how the advertising industry tackles cross-device tracking, and specifically this section could be interesting for your case:
There are two ways to establish user identity across devices, one far more exact – and therefore potentially more problematic from a privacy perspective – than the other.
The deterministic method relies on personally identifiable information (PII) to make device matches when a person uses the same email address to log into an app and a website, thereby creating cross-device linkage. As long as a user is logged in across devices, advertisers and publishers can use this unique identifier to target those users on multiple screens with near-perfect precision.
...
Probabilistic cross-device matching is achieved by algorithmically analyzing thousands of different anonymous data points – device type, operating system, location data associated with bid requests, time of day and a host of others – to create statistical, aka likely, matches between devices. For example, if a phone, a tablet and a laptop connect to the same networks or Wi-Fi hotspots in the same places every weekday, it’s safe to surmise that all three devices belong to a specific commuter.
To conclude, I think that FB is using a combination of both the deterministic and probabilistic methods to conclude you were the user on both machines and serve you Amazon's retargeting ads.