I like many of my shell scripts portable and shell-agnostic, so I prefer trapping EXIT over using the bash-specific .bash_logout method. And for a truly self-contained solution it's best not having to modify or create .bash_logout, nor rely on a separate script to be run on exit. And of course far worse would be modifying or overriding what the "exit" command itself does on the system - the solution should not affect anyone else!
So for minimal impact on foreign systems, my preferred method is to drop a custom login profile in place whenever I start working on a system, and having that same profile clean up itself and any helper scripts or config files it creates. I then source that profile (using "." which works under ksh too), which sets up all my aliases etc. - but I don't want it sticking around when I'm done.
So I create a shell function "bye" in the script itself that performs said cleanup, and register it for auto-cleanup on logout, whether intentional or by simple disconnection, via:
trap bye EXIT
That ensures I'm not leaving ugly traces of my work behind. Which specific cleanup it should perform is up to you, the directory-specific "make clean" is just one of many possibilities. And once the logout has occurred via whatever means, all traces of the profile including even the cleanup function are gone.
You can go one step further - perhaps there's different types of systems on which you want different types of cleanup to occur, or on some systems you don't want this sort of cleanup to occur at all. You could build switches into the "bye" shell function, or make different ones "bye1", "bye2" and register the desired one based on some test, e.g. the existence of some file. That's how I prevent deletion of my custom profile on systems I use longer-term, where I want to keep the same profile around.