How to stop the execution of Travis if script exits with an error

Above is the link to the travis script.
I am running a makefile from within it and I want to fail the build if the makefile script fails. ( fast fail)
Saw about travis_terminate options around the web but not sure if this is the right approach. Also could not find any similar thing in the documentation.
I would appreciate if somebody can help me with this.

The script phase is designed for tests – i.e. when you want to run everything even if something fails.

To do stuff after tests, place those commands in other phases (see https://docs.travis-ci.com/user/job-lifecycle/), or run some kind of a compound command.

Imprint