--- Makefile.orig	2020-06-26 10:13:22.473970426 +0200
+++ Makefile	2020-06-26 10:16:07.918622654 +0200
@@ -10,7 +10,7 @@
 CC         ?= cc
 CXX        ?= c++
 NVCC       ?= nvcc
-FORT       ?=
+FORT       ?= $(FC)
 ifeq ($(FORT),)
     $(warning No Fortran compiler was given in FORT in make.inc. Some testers will not be able to check their results.)
 endif
@@ -23,17 +23,17 @@
 #FPIC       = -fPIC
 
 # may want -std=c99 for CFLAGS, -std=c++11 for CXXFLAGS
-CFLAGS     ?= -O3 $(FPIC) -DADD_ -Wall -MMD
-CXXFLAGS   ?= $(CFLAGS) -std=c++11
-NVCCFLAGS  ?= -O3         -DADD_ -Xcompiler "$(FPIC) -Wall -Wno-unused-function" -std=c++11
-FFLAGS     ?= -O3 $(FPIC) -DADD_ -Wall -Wno-unused-dummy-argument
-F90FLAGS   ?= -O3 $(FPIC) -DADD_ -Wall -Wno-unused-dummy-argument
-LDFLAGS    ?= -O3 $(FPIC)
+CFLAGS     := $(FPIC) -DADD_ -Wall -MMD $(CFLAGS)
+CXXFLAGS   := $(CFLAGS)
+NVCCFLAGS  :=         -DADD_ -Xcompiler " -Wall -Wno-unused-function -DADD_ -MMD -O2 -ftree-vectorize -march=native -fno-math-errno -fopenmp -fPIC"
+FFLAGS     := $(FPIC) -DADD_ -Wall -Wno-unused-dummy-argument $(FCFLAGS)
+F90FLAGS   := $(FPIC) -DADD_ -Wall -Wno-unused-dummy-argument $(F90FLAGS)
+LDFLAGS    := $(FPIC) -fopenmp $(LDFLAGS)
 
 INC        ?= -I$(CUDADIR)/include
 
 LIBDIR     ?= -L$(CUDADIR)/lib64
-LIB        ?= -lcudart -lcudadevrt -lcublas -lcusparse -llapack -lblas -lpthread -lm
+LIB        ?= $(LIBLAPACK) -lcudart -lcublas -lcusparse $(LIBS)
 
 GPU_TARGET ?= Kepler Maxwell Pascal
 
