build: fix out of tree builds

The test directory needs -I$(top_srcdir) in order to find the
header files provided by the project itself.  When doing an in-tree
build, this is done automatically by automake due to 'config.h'
being generated in the root.

Change-Id: I5e59715657684a8019e9c48c835b29eb326f01a8
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/test/Makefile.am b/test/Makefile.am
index 6bed2cb..75658aa 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,3 +1,4 @@
+AM_CPPFLAGS = -I$(top_srcdir)
 check_PROGRAMS =
 
 # Run all 'check' test programs
@@ -5,7 +6,7 @@
 
 # Build/add sample_unittest to test suite
 check_PROGRAMS += sample_unittest
-sample_unittest_CPPFLAGS = -Igtest $(GTEST_CPPFLAGS)
+sample_unittest_CPPFLAGS = -Igtest $(GTEST_CPPFLAGS) $(AM_CPPFLAGS)
 sample_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
 sample_unittest_LDFLAGS = -lgtest_main -lgtest $(PTHREAD_LIBS) $(OESDK_TESTCASE_FLAGS)
 sample_unittest_SOURCES = sample_unittest.cpp