--- a/Makefile.PL
+++ b/Makefile.PL
@@ -3,14 +3,27 @@
 use ExtUtils::MakeMaker;
 use Config;
 
-# use PDL::Core::Dev;  # needed for stand-alone version of package.
-                       # Need to comment out
-                       # for package included in PDL distro.
+#eval {
+#  require PDL::Core::Dev;  # needed for stand-alone version of package.
+#                           # Need to comment out
+#                           # for package included in PDL distro.
+#
+#  PDL::Core::Dev->import;
+#};
+#my $pdl_installed = ($@) ? 0 : 1; # make always == 1 for install from PDL distro.
+my $pdl_installed = 1;
+#print "PDL ", ($pdl_installed ? '' : 'not'), " installed\n";
+
+if (!$pdl_installed) {
+  # write dummy makefile if PDL not installed
+  WriteMakefile(
+		'NAME'         => 'PDL::Graphics::PLplot',
+		'PREREQ_PM'    => { PDL => 0 },
+		);
+  exit;
+}
 
 use vars qw /$plplotvers/; # version of plplot used
-
-# Pick up development utilities
-PDL::Core::Dev->import();
 
 # 
 ## Search for plplot library and include file
@@ -23,6 +36,7 @@
 # use $Config{"so"} to get the extension name
 #
 my $libname = "libplplotd." . $Config{"so"};
+my $libname_static = "libplplotd.a";
 my $incname = "plplot.h";
 
 my $found_plplot =
@@ -35,15 +49,11 @@
   return if (caller); exit;
 }
 foreach my $libdir (
-                    '/usr/local/plplot/lib64',
                     '/usr/local/plplot/lib',
-		    '/usr/local/lib64',
 		    '/usr/local/lib',
-		    '/usr/lib64',
+		    '/opt/local/lib',
 		    '/usr/lib',
-		    '/opt/lib64',
 		    '/opt/lib',
-		    '/ops/tools/lib64',
 		    '/ops/tools/lib',
                     '/sw/lib/',    # default FINK installation
 		    $PDL::Config{WHERE_PLPLOT_LIBS},
@@ -54,10 +64,10 @@
     $plplot_lib_path = $libdir;
     $ENV{LD_LIBRARY_PATH} .= ":$libdir";
     last;
-  } elsif (-e "$libdir/$libname.a") {
+  } elsif (-e "$libdir/$libname_static") {
     $plplot_lib_path = $libdir;
     $ENV{LD_LIBRARY_PATH} .= ":$libdir";
-    $libname = $libname . ".a";
+    $libname = $libname_static;
     last;
   }
 
@@ -186,10 +196,11 @@
 @pack = (["plplot.pd",PLplot,PDL::Graphics::PLplot]);
 
 %hash = pdlpp_stdargs_int(@::pack);  # use this for module inside PDL source
-### %hash = pdlpp_stdargs(@::pack);          # use this for separate module          
-
+###%hash = pdlpp_stdargs(@::pack);          # use this for separate module          
+
+$hash{'PREREQ_PM'} = { PDL => 0 };
 $hash{'OPTIMIZE'}  = '-g'; # If you want to debug, uncomment this.
-$hash{'VERSION'}   = '0.31';
+$hash{'VERSION'}   = '0.38';
 $hash{'LIBS'}      = [$libs];
 # add this to allow one to use the /ops/tools/lib plplot libs even when
 # another plplot is installed in /usr/local/lib. D. Hunt 6/4/2004
@@ -198,13 +209,13 @@
 $hash{'clean'}     = {'FILES'  =>
 			  'PLplot.pm PLplot.xs PLplot.o PLplot.c PLplot.bs *.xfig temp* OPTIONS! Makefile.old'};
 
+#my $postamble = pdlpp_postamble(@::pack); # use for external module
+my $postamble = pdlpp_postamble_int(@::pack); # use for install inside PDL distro
+
 WriteMakefile(%hash);
 
 # Add genpp rule
-sub MY::postamble {
-    pdlpp_postamble_int(@::pack);  # use this for module inside PDL source 
-### pdlpp_postamble(@::pack);	   # use this for separate module          
-}
+sub MY::postamble { $postamble };
 
 sub compileAndRun {
   my $flags = shift;