1. Do not build internal LAPACK, since linking to it fails: https://github.com/Dsplib/libdspl-2.0/issues/5
2. Use the right compiler.
3. Add missing headers: https://github.com/Dsplib/libdspl-2.0/issues/8
4. Do not link to libquadmath on PPC, it is not there.
--- dspl/Makefile
+++ dspl/Makefile
@@ -67,8 +67,8 @@
      $(RELEASE_DIR)/dspl.h
 
 #Build libdspl.dll or libdspl.so
-$(RELEASE_DIR)/$(LIB_NAME): $(DSPL_OBJ_FILES)  $(BLAS_LIB_NAME) $(LAPACK_DOUBLE_LIB_NAME) $(LAPACK_COMPLEX_LIB_NAME)
-	$(CC) -shared -o $(RELEASE_DIR)/$(LIB_NAME)  $(DSPL_OBJ_FILES) -lm  -L$(LAPACK_RELEASE_DIR) -llapack_complex -llapack_double -L$(BLAS_RELEASE_DIR) -lblas -lgfortran -lquadmath
+$(RELEASE_DIR)/$(LIB_NAME): $(DSPL_OBJ_FILES)
+	$(CC) -shared -o $(RELEASE_DIR)/$(LIB_NAME) $(DSPL_OBJ_FILES) -lm -L@PREFIX@/lib -llapack -lblas $(EXTRAFLIBS)
 
 
 
@@ -119,18 +119,6 @@
 $(VERIFICATION_BIN_DIR)/$(LIB_NAME):$(RELEASE_DIR)/$(LIB_NAME)
 	cp $(RELEASE_DIR)/$(LIB_NAME) $(VERIFICATION_BIN_DIR)/$(LIB_NAME)
 
-#make BLAS library
-$(BLAS_LIB_NAME):
-	$(MAKE) -C blas
-
-#make LAPACK library for the real data
-$(LAPACK_DOUBLE_LIB_NAME):
-	$(MAKE) -C lapack
-
-#make LAPACK library for the complex data
-$(LAPACK_COMPLEX_LIB_NAME):
-	$(MAKE) -C lapack
-
 #Copy dspl.c source to the release folder 
 $(RELEASE_DIR)/dspl.c:
 	cp $(INC_DIR)/dspl.c $(RELEASE_DIR)/dspl.c
--- dspl/src/dft/fft_cmplx.c
+++ dspl/src/dft/fft_cmplx.c
@@ -24,6 +24,7 @@
 #include <float.h>
 
 #include "dspl.h"
+#include "dft.h"
 
 
 #ifdef DOXYGEN_ENGLISH
--- dspl/src/dft/ifft_cmplx.c
+++ dspl/src/dft/ifft_cmplx.c
@@ -24,6 +24,7 @@
 #include <float.h>
 
 #include "dspl.h"
+#include "dft.h"
 
 
 #ifdef DOXYGEN_ENGLISH
--- dspl/src/gnuplot/gnuplot_create.c
+++ dspl/src/gnuplot/gnuplot_create.c
@@ -18,6 +18,7 @@
 * along with Foobar.    If not, see <http://www.gnu.org/licenses/>.
 */
 #include <stdio.h>
+#include <string.h>
 #include <unistd.h>
 #include "dspl.h"
 
--- make.inc
+++ make.inc
@@ -1,28 +1,11 @@
-CC       = gcc
-FORTRAN  = g++
+CC       = @CC@
+FORTRAN  = @FC@
 AR       = ar
 
 # DSPL source and obj file path
 DSPL_SRC_DIR = src
 DSPL_OBJ_DIR = obj
 
-# BLAS source path
-BLAS_LIB_DIR = blas
-BLAS_SRC_DIR = $(BLAS_LIB_DIR)/src
-BLAS_RELEASE_DIR = $(BLAS_LIB_DIR)/bin
-BLAS_LIB_NAME = $(BLAS_RELEASE_DIR)/libblas.a
-
-# LAPACK source path
-LAPACK_LIB_DIR  =   lapack
-LAPACK_RELEASE_DIR = $(LAPACK_LIB_DIR)/bin
-
-LAPACK_DOUBLE_SRC_DIR  = $(LAPACK_LIB_DIR)/src
-LAPACK_DOUBLE_LIB_NAME = $(LAPACK_RELEASE_DIR)/liblapack_double.a
-
-LAPACK_COMPLEX_SRC_DIR  = $(LAPACK_LIB_DIR)/src
-LAPACK_COMPLEX_LIB_NAME = $(LAPACK_RELEASE_DIR)/liblapack_complex.a
-
-
 
 INC_DIR = ../include
 RELEASE_DIR = ../_release
@@ -34,6 +17,7 @@ ifeq ($(OS),Windows_NT)
 	DSPL_LIBNAME = libdspl.dll
 	DEF_OS = WIN_OS
 	LFLAGS = -lm
+	EXTRAFLIBS = -lgfortran -lquadmath
 else
 	UNAME_S := $(shell uname -s)
 	UNAME_P := $(shell uname -p)
@@ -41,10 +25,16 @@ else
 		DSPL_LIBNAME = libdspl.so
 		DEF_OS = LINUX_OS
 		LFLAGS = -lm -ldl
+		EXTRAFLIBS = -L@PREFIX@/lib/libgcc -lgfortran -lquadmath
 	else ifeq ($(UNAME_S),Darwin)
 		DSPL_LIBNAME = libdspl.so
 		DEF_OS = LINUX_OS
 		LFLAGS = -lm -ldl
+		ifeq ($(UNAME_P),powerpc)
+			EXTRAFLIBS = -L@PREFIX@/lib/libgcc -lgfortran
+		else
+			EXTRAFLIBS = -L@PREFIX@/lib/libgcc -lgfortran -lquadmath
+		endif
 	endif
 endif
 
