Border wait times are often large at certain times of the day - this is true for many other US airports. Booking a short connecton after an international flight is always risky.
If you travel internationally frequently, apply for NEXUS - expedited security in canada, no border waits entering us or canada (by air or land). As a NEXUS holder, you can use global entry kiosks when entering US.