Hooking WriteMakefile wouldn't work on Module::Build, and it wouldn't work for a makefile.pl that gets $Config{cc} and runs the compiler itself. As said elsewhere in this thread, searching the source code for Dynaloader is another choice, even for this post
Pure Perl module(246 lines, Linux/Win32) that calls external libraries - no XS file.. Then again "Dynaloader" as a string can be obfuscated.