The short version is that you shouldn't expect an executable compiled for one version of Linux to work on another. The simple explanation is that because of all the variations between all the different types and releases of Linux, the only way that an executable is likely to run is if it was compiled with the same version of the same release of the operating system. Here's a good article with details to help you understand:
This is why CS50 makes a virtual machine available to the class. By having everyone work in the same virtual environment, they can eliminate almost all of the issues that would manifest if everyone used their own preferred Linux environment.
If this (and earlier comments) answers your question, please accept this answer to mark the question as answered and remove it from the unanswered question pool. Let's keep up on forum housekeeping. ;-)