--- Makefile.PL.orig	2009-05-12 06:31:06.000000000 -0700
+++ Makefile.PL	2011-11-04 15:38:45.000000000 -0700
@@ -7,7 +7,7 @@
 use lib qw(inc);
 use Devel::CheckLib;
 
-check_lib_or_exit( lib => 'magic', header => 'magic.h' );
+check_lib_or_exit( lib => 'magic', header => 'magic.h', incpath => "__PREFIX__/include", libpath => "__PREFIX__/lib" );
 
 WriteMakefile(
     'NAME'		=> 'File::LibMagic',
@@ -15,7 +15,7 @@
     'PREREQ_PM'		=> { },
     'ABSTRACT_FROM'     => 'LibMagic.pm', # retrieve abstract from module
     'AUTHOR'            => 'Andreas Fitzner <andreas.fitzner@fv-berlin.de>',
-    'LIBS'		=> ['-lmagic -lz'], # e.g., '-lm'
+    'LIBS'		=> ['-L__PREFIX__/lib -lmagic -lz'], # e.g., '-lm'
     'DEFINE'		=> '', # e.g., '-DHAVE_SOMETHING'
     'INC'		=> '-I.', # e.g., '-I. -I/usr/include/other'
 	# Un-comment this if you add C files to link with later:
