fatal error: delay.h: No such file or directory

Remove this: #include <delay.h>
Keep this: volatile long motor_position, encoder;