Since this is often an older library for legacy shields, installing it via the ZIP method is reliable.

#include <AFMotor.h>

To get started, you can download the library as a ZIP file from these official and community repositories: